<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head "南航明珠商城-商品列表">
</@frame.head>
<link rel="stylesheet" type="text/css" href="${contextPath}/resources/css/search_table.css" />
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 后台管理中心 <span class="c-gray en">&gt;</span> 商品管理 <span class="c-gray en">&gt;</span> 商品列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
<form method="post" name="query_product_form"  id="query_product_form" action="${contextPath}/product/query_product" >    
   <input type="hidden" name="page" value="${pagination.pageNo}"  id="page" />  
   <input type="hidden" name="checkboxs" value="${checkboxs}"  id="checkboxs" />
   <input type="hidden" name="upOrDown" value="${upOrDown}"  id="upOrDown" />                           
    <div class="text-c">
        <table class="table search_table">
           <tr>  
           <td>商品编号：</td>
           <td><input type="text" class="input-text  radius"  placeholder="商品编号" id="" name="prodId" value="${(productQo.prodId?c)!}" ></td>
           <td>商品名称：</td>
           <td><input type="text" class="input-text  radius"  placeholder="商品名称" id="" name="proName" value="${productQo.proName}"></td>  
           <td>商户名称：</td>
           <td>
           
           <span class="select-box radius">
           <select class="select"  name="merchantQo.id" >
           <option value>请选择</option>
             <#list merchantNewList as list>  
                 <option value="${list.id?c}" <#if list.id==productQo.merchantQo.id>selected="selected"</#if>>${list.mercName}</option>
             </#list>
           </select>
           </span>
           </td>  
          </tr>
          <tr>
           <td>审核状态：</td>
           <td>
           <span class="select-box radius">
           <select class="select"  name="status" >
               <option value>请选择状态</option>
               <option value ="1" <#if productQo.status=1>selected="selected"</#if>>未审核</option>
               <option value ="3" <#if productQo.status=3>selected="selected"</#if>>审核未通过</option>
               <option value ="4" <#if productQo.status=4>selected="selected"</#if>>初审通过</option>
               <option value ="5" <#if productQo.status=5>selected="selected"</#if>>复审通过</option>
               <option value ="2" <#if productQo.status=2>selected="selected"</#if>>终审通过</option>
           </select>
           </span>
           </td>      
           <td>上架状态：</td>
           <td>
           <span class="select-box radius">
           <select class="select"  name="isBuy" >
               <option  value>请选择状态</option>
               <option value ="4" <#if productQo.isBuy=4>selected="selected"</#if>>未上架</option>
               <option value ="5" <#if productQo.isBuy=5>selected="selected"</#if>>已上架</option>
           </select>
           </span>
           </td>     
        
           <td>编辑时间：</td>
           <td style="padding: 0px;">
             <table style="padding: 0px;margin: 0px;">
               <tr>
                 <td style="width: 48%;">
                   <input type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'endDate\')||\'%y-%M-%d\'}',readOnly: true })" id="startDate" 
                    value='${(productQo.updateBeginDate?string("yyyy-MM-dd"))!}' name="updateBeginDate" class="input-text Wdate radius"/>
                 </td>
                 <td style="width: 4%;"> 至</td>
                 <td style="width: 48%;">
                   <input type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'startDate\')}',maxDate:'%y-%M-%d',readOnly: true })" id="endDate" 
                   value='${(productQo.updateEndDate?string("yyyy-MM-dd"))!}' name="updateEndDate" class="input-text Wdate radius"/>
                 </td>
               </tr>
             </table>
           </td>
         </tr>
         <tr>
           <td>商品类型：</td>
           <td>
           <span class="select-box radius">
           <select class="select"  name="productType" >
            <option value>请选择类型</option>
            <option  value="1" <#if productQo.productType=1>selected="selected"</#if>>实物商品</option>
            <option  value="2" <#if productQo.productType=2>selected="selected"</#if>>虚拟商品</option>
            <option  value="3" <#if productQo.productType=3>selected="selected"</#if>>机票优惠券</option>
            <option  value="4" <#if productQo.productType=4>selected="selected"</#if>>其他</option>  
            <option  value="5" <#if productQo.productType=5>selected="selected"</#if>>公益产品</option>     
           </select>
           </span>         
           </td>
           <td>商品分类：</td>
           <td>
             <span class="select-box radius">
               <select class="select"  name="proType" >   
                 <option value>请选择</option>
                 <#list prodTypeList as list>  
                 <option value="${list.id?c}" <#if list.id==productQo.proType>selected="selected"</#if>>${list.name}</option>
                 </#list>
               </select>
             </span>  
           </td>  
           <td>商品品牌：</td>
           <td>
             <span>
               <select class="select"  name="brandId" id="brandselect" >
                <option value>请选择</option>
                 <#list brandList as list>  
                 <option value="${list.id?c}" <#if list.id==productQo.brandId>selected="selected"</#if>>${list.name}</option>
                 </#list>               
               </select>
             </span>  
           </td>  
         </tr>
         <tr><td colspan="6" style="text-align:center;" >
           <input class="btn btn-success radius" type="button"  onclick="search(true);"  value="搜索" />
           <input class="btn btn-success radius" type="button"  onclick="toIsEmpty();" value="重置" />
           <input class="btn btn-success radius" type="button"  onclick="search();"   value="刷新" />
           <input class="btn btn-success radius" type="button"  onclick="slimport();"   value="导出" />
             </td>
         </tr>
      </table>
    </div>
</form>

    <div class="cl pd-5 bg-1 bk-gray mt-20"> 
    <span class="l">
    <a href="javascript:;" id="upProduct" onclick="upProductBuy();" class="btn btn-primary radius"> 批量上架</a> 
    <a href="javascript:;" id="downProduct" onclick="downProductBuy();" class="btn btn-primary radius"> 批量下架</a>
    <a href="javascript:;" id="cancelCheck" onclick="cancelCheck();" class="btn btn-primary radius"> 取消</a>
    </span>
    
    <span class="r">共有数据：<strong>${pagination.totalCount}</strong> 条</span> </div>
    <table class="table table-border table-bordered table-bg">
        <thead>
        <tr   class="text-c">
            <th width="45px">
            <input  type="checkbox" id="selectAll" disabled="disabled" onclick="checkAll()"/>
            </th>
            <th >商品编号</th>
            <th >商品名称</th>
            <th >商品类别</th>
            <th >商品类型</th>
            <th >编辑时间</th>
            <th >审核状态</th>
            <th >上架状态</th>
            <th width="150" > 操作</th>
        </tr>
        </thead>
        <tbody>
       <#if pagination.list?? && (pagination.list?size &gt; 0) >
        <#list pagination.list as product> 
             <tr  class="text-c">
                <td>
                   <#if  product.statusInfo.status=2> <input  style="display:none;" type="checkbox" name="ProducIsBuyId" id="${product.id?c}" /> </#if>         
                </td>
                <td>${product.id?c}</td>
                <td>${product.baseInfo.name}</td>
                <td>${product.productProperty.prodTypeOne.name}
                  <#if product.productProperty.prodTypeTwo.name??>&lt;${product.productProperty.prodTypeTwo.name}</#if>
                  <#if product.productProperty.prodTypeThree.name??>&lt;${product.productProperty.prodTypeThree.name}</#if>
                </td>
                <td>
                    ${typeMap["${product.proType}"]}
                    <#if product.proType=4>
                         <#if product.otherType=1>-机票资质 
                         <#elseif product.otherType=2>-升舱资质     
                         </#if>
                    </#if>
                 </td>
                 <td >
                    <#if product.updateDate??>
                       ${product.updateDate?string("yyyy-MM-dd")}  
                       <#else>
                       ${product.createDate?string("yyyy-MM-dd")}  
                    </#if>
                 </td>
                 <td>
                     ${auditStatusMap["${product.statusInfo.status}"]}
                 </td>
                 <td width="55">
                    <input type="hidden" id="productBuy${product.id?c}" value="${product.statusInfo.isBuy}" />                                           
                     <#if product.statusInfo.isBuy=4><span class="label radius">未上架</span>
                     <#elseif product.statusInfo.isBuy=5><span class="label label-success radius">已上架</span>
                     </#if> 
                 </td>
                 <td width="60">
                 <div id="td_caozuo_${product.id?c}">
                 <#if product.statusInfo.status=1>
                   <a href="javascript:void(0);" onClick="audit_product('${product.id?c}','1')">初审</a>             
                 <#elseif product.statusInfo.status=2>
                      <#if product.statusInfo.isBuy=4>
                         <a href="javascript:void(0);" onclick="toBuy(${product.id?c},5)">上架</a>
                      <#elseif product.statusInfo.isBuy=5>
                         <a href="javascript:void(0);" onclick="toBuy(${product.id?c},4)" >下架</a>
                      </#if>
                 <#elseif product.statusInfo.status=4>
                   <a  href="javascript:void(0);" onClick="audit_product('${product.id?c}','4')">复审</a>
                 <#elseif product.statusInfo.status=5>
                   <a  href="javascript:void(0);" onClick="audit_product('${product.id?c}','5')">终审</a>
                 </#if>  
                 
                 <!-- <a  href="javascript:deleteProduct('${id}')">删除</a> -->                                   
                 <a href="javascript:void(0);" onClick="edit_product('编辑商品','${contextPath}/product/per_update_product?prodId=${product.id?c}','10005','1000','650')">编辑</a>
                 <a href="javascript:void(0);" onClick="look_product('查看商品','${contextPath}/product/look_product?prodId=${product.id?c}','10004','1000','600')">查看</a>
                 <#if product.proType=2>
                   <a href="javascript:void(0);" onClick="layer_show('电子码信息','${contextPath}/product/query_electronic_code_batch?prodId=${product.id?c}','800','600')">电子码信息</a>
                 <#elseif product.proType=3>
                   <a href="javascript:void(0);" onClick="layer_show('活动号管理','${contextPath}/ticket_coupon/query_active_list?productId=${product.id?c}','1000','600')">活动号管理</a>
                 </#if> 
                 </div>
                 </td>
        </tr>
      </#list></#if>
     </tbody>
    </table>
    <div id="biuuu_city" style="padding-top: 10px;float: right"></div>
</div>
</div>
<@frame.end "default">
</@frame.end>
</html>
<script type="text/javascript" src="${contextPath}/resources/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/laypage/laypage.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/product/product_list.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/select/py.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/select/Popt.js"></script>
<link rel="stylesheet" type="text/css" href="${contextPath}/resources/css/select/jquery.searchableSelect.css" />
<script type="text/javascript" src="${contextPath}/resources/js/select/jquery.searchableSelect.js"></script>
<script type="text/javascript">
var path="${contextPath}";
laypage({
    cont: 'biuuu_city',//容器。值支持id名、原生dom对象，jquery对象。
    pages: ${pagination.totalPage},//通过后台拿到的总页数
    curr:  ${pagination.pageNo} || 1, //当前页
	skip: true, //是否开启跳页
	first: 1, //将首页显示为数字1,。若不显示，设置false即可
	last: ${pagination.totalPage}, //将尾页显示为总页数。若不显示，设置false即可
    jump: function(obj , first){//触发分页后的回调
        if(!first){ //点击跳页触发函数;当前页为obj.curr
            $("#page").val(obj.curr);
            saveCheckBoxs();
            $("#query_product_form").submit();
        }
    }
})  
</script>